package com.whw.fy.controller;

import com.whw.fy.entity.Message;
import com.whw.fy.entity.Supervisor;
import com.whw.fy.service.SupervisorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;

@Api(tags = "教学督导模块")
@RestController
@RequestMapping("/api/supervisor")
public class SupervisorController {
    @Resource
    private SupervisorService supervisorService;

    @ApiOperation(value = "添加教学督导信息")
    @PostMapping("/one")
    public Message insert(Supervisor supervisor) {

        return supervisorService.insertSelective(supervisor);
    }

    @ApiOperation(value = "删除教学督导")
    @DeleteMapping("/")
    public Message delete(Integer supervisorId) {
        return supervisorService.deleteByPrimaryKey(supervisorId);
    }

    @ApiOperation(value = "修改教学督导")
    @PutMapping("/")
    public Message update(Supervisor supervisor) {
        return supervisorService.updateByPrimaryKeySelective(supervisor);
    }

    @ApiOperation(value = "获取所有教学督导")
    @GetMapping("/all")
    public Message selectAll(){
        return supervisorService.selectAll();
    }

    @ApiOperation(value = "根据教学督导id获取教学督导")
    @GetMapping("/one")
    public Message selectByPrimaryKey(Integer supervisorId){
        return supervisorService.selectByPrimaryKey(supervisorId);
    }

}
